package com.dmm.user.mapper;

import com.dmm.user.entity.ExamineinfoVo;
import com.dmm.user.entity.Examineinfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author com/dmm
 * @since 2023-04-07
 */
public interface ExamineinfoMapper extends BaseMapper<Examineinfo> {

    @Update("UPDATE examineinfo SET number=number-1 where email=#{email}")
    boolean updateNumber(String email);

    List<ExamineinfoVo> getquantity();

    ExamineinfoVo getavg();

    @Select("SELECT DISTINCT(email)  FROM `examineinfo` where email !=#{email}and email not in (SELECT start_email FROM association where #{email}=end_email)")
    List<String> getnames(String email);
}
